import { DataSource } from 'typeorm';
import { PostsEntity } from './modules/posts/entities/post.entity';

export const AppDataSource = new DataSource({
  type: 'mysql',
  host: 'localhost',
  port: 3306,
  username: 'root',
  password: 'shawn123456',
  database: 'forumBlog',
  // charset: 'utf8mb4',
  timezone: '+08:00',
  synchronize: true, // 是否同步，如果为true，新建的实体会更新建表或更新字段
  logging: true, // 是否开启日志，为true 为打印执行的sql
  entities: [PostsEntity], // 数据表实体
});
